﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace DELVE_GAME.ViewStructure
{
    class HudComponent : ViewComponent
    {
        SpriteFont font;
        PlayStage stage;
        Sprite tileSprite;

        public HudComponent(PlayStage stage, SpriteFont font, int x, int y, Sprite tiles)
        {
            this.font = font;
            this.x = x;
            this.y = y;
            this.stage = stage;
            tileSprite = tiles;
        }

        public void setFont(SpriteFont font)
        {
            this.font = font;
        }

        public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            if (font == null)
            {
                throw new InvalidOperationException("This object currently has no font set.");
            }
            sb.Begin();
            sb.DrawString(font, stage.getDataToDisplay(), new Vector2(this.x, this.y), Color.White);
            sb.End();
            tileSprite.draw(sb, this.x, this.y-70, View.getHudTileType(), 1, Color.White);
        }

        public override void mouseOver(int x, int y)
        {
            //throw (new NotImplementedException());
        }

        public override void mousePressed(int x, int y)
        {
            //throw (new NotImplementedException());
        }

        public override void mouseReleased(int x, int y)
        {
            //throw (new NotImplementedException());
        }

        public override void keyPressed(Microsoft.Xna.Framework.Input.Keys key)
        {
            //throw (new NotImplementedException());
        }

        public override void keyReleased(Microsoft.Xna.Framework.Input.Keys key)
        {
            //throw (new NotImplementedException());
        }
    }
}
